<%@page import="com.dingpeikeji.quickdeer.modules.rentproduct.entity.TDemands"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<jsp:include page="/WEB-INF/views/layouts/head.jsp"></jsp:include>
<c:set var="REACTSTATUS_WAIT" value="<%=TDemands.REACTSTATUS_WAIT %>" />
<c:set var="REACTSTATUS_DONE" value="<%=TDemands.REACTSTATUS_DONE %>" />
<c:set var="REACTSTATUS_SURE" value="<%=TDemands.REACTSTATUS_SURE %>" />
<c:set var="REACTSTATUS_CANCEL" value="<%=TDemands.REACTSTATUS_CANCEL %>" />
<html>
<head>
<title>定制包车</title>
<link href="${ctxStatic }/xiake/css/list.css" rel='stylesheet'type='text/css' />
<link href="${ctxStatic }/xiake/css/style.css" rel='stylesheet'type='text/css' />
<link href="${ctxStatic }/index/css/customized.css" rel="stylesheet">
<script src="${ctxStatic }/index/js/customized.js"></script>
</head>
<script type="text/javascript">
var yes = "${fns:getDictValue('是','yes_no','')}"; // 字典yes_no的“是”
$(function(){
	var keyVal2 = "${sessionScope.mes}";
	$('input[name=ispublic]').trigger('change');
	<c:if test="${not empty tDemands.demandid }">
		$('input').attr('disabled','disabled');
		$('textarea').attr('disabled','disabled');
		$('select').attr('disabled','disabled');
	</c:if>
	$("#form").click(function(){
		window.location.href = "${ctxFront }/rentproduct/demands/form";
	})
	$("#list").click(function(){
		window.location.href = "${ctxFront }/rentproduct/demands";
	});
	$(".cancel").click(function(){
		$("#demand_id").val($(this).attr("value"));
        $("#neer").show();
    });
	$("#no").click(function(){
		window.location.href = "${ctxFront }/rentproduct/demands/list";
    });
	$("#delno").click(function(){
		window.location.href = "${ctxFront }/rentproduct/demands/list";
    });
	$(".deldels").click(function(){
		$("#demand_ids").val($(this).attr("value"));
        $("#deldel").show();
    });
});
function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
	return false;
}
</script>
<body>
<input type="hidden" id="menuInfo" value="indexDemands">
<div class="custcar">
    <div class="container">
        <ul class="tabs" style="float: left">
            <li><a href="#tab1" id="form">定制包车</a></li>
            <li><a href="#tab2" id="list">我的需求</a></li>
        </ul>
</div>
	<div id="tab2" class="tab_content" style="float: right">
<div>
<form id="searchForm" action="${ctxFront }/rentproduct/demands" method="get">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <dl>
        <dd class="start_date">
            <span class="start_date_1">起始日期&nbsp;:&nbsp;</span>
            <input type="text" id="createDateQueryStart" style="width: 110px;height: 30px" name="createDateQueryStart" maxlength="20" readonly class="order_table_s Wdate"
			value="${tDemands.createDateQueryStart }"
			onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,maxDate:'#F{$dp.$D(\'createDateQueryEnd\')}'});"/>
		 - <input type="text" id="createDateQueryEnd" style="width: 110px;height: 30px" name="createDateQueryEnd" maxlength="20" readonly class="order_table_s Wdate"
			value="${tDemands.createDateQueryEnd }"
			onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,minDate:'#F{$dp.$D(\'createDateQueryStart\')}'});"/>
            <span class="start_date_1">反馈状态&nbsp;:&nbsp;</span>
            <select name="reactstatus" style="width: 110px;height: 30px">
			<option value="">全部</option>
			<option value="${REACTSTATUS_WAIT }" ${tDemands.reactstatus==REACTSTATUS_WAIT?'selected':'' }>待响应</option>
			<option value="${REACTSTATUS_SURE }" ${tDemands.reactstatus==REACTSTATUS_SURE?'selected':'' }>已响应</option>
			<option value="${REACTSTATUS_DONE }" ${tDemands.reactstatus==REACTSTATUS_DONE?'selected':'' }>已支付</option>
			<option value="${REACTSTATUS_CANCEL }" ${tDemands.reactstatus==REACTSTATUS_CANCEL?'selected':'' }>已取消</option>
			</select>
            <input class="inquiry" type="button" value="查询" onclick="$('#searchForm').submit();">
        </dd>
    </dl>
    </form>
    <div class="xuxian"></div>
    <div style="padding-top: 20px">

        <table class="demand">
            <tr class="demand-1">
                <td>发布时间</td>
                <td>车型</td>
                <td>包车数量</td>
                <td>用车时间</td>
                <td>包车天数</td>
                <td>出发地</td>
                <td>目的地</td>
                <td>反馈状态</td>
                <td>操作</td>
            </tr>
            <c:forEach items="${page.list}" var="tDemands">
			<tr style="line-height: 50px;height: 50px">
				<td class="order_table_td"><fmt:formatDate value="${tDemands.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td class="order_table_td">${tDemands.cartype.typename}</td>
				<td class="order_table_td">${tDemands.vehiclenum}</td>
				<td class="order_table_td"><fmt:formatDate value="${tDemands.fromdate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				<td class="order_table_td">${tDemands.rentdays}</td>
				<td class="order_table_td">${tDemands.departcity.sitename}</td>
				<td class="order_table_td">${tDemands.destcity.sitename}</td>
				<td class="order_table_td">
					${tDemands.reactstatus==REACTSTATUS_WAIT?'待响应':'' }
					${tDemands.reactstatus==REACTSTATUS_DONE?'已支付':'' }
					<c:if test="${tDemands.reactstatus==REACTSTATUS_SURE }">
						<span class="red">已响应
							<c:if test="${not empty tDemands.rectcount }">
								<span>(${tDemands.rectcount })</span>
							</c:if>
						</span>
					</c:if>
					${tDemands.reactstatus==REACTSTATUS_CANCEL?'已取消':'' }
				</td>
				<td>
					<div>
						<a href="${ctxFront }/rentproduct/demands/form?demandid=${tDemands.demandid}" class="container_table_y2 pointer" >查看</a>
						<c:if test="${tDemands.reactstatus ne REACTSTATUS_CANCEL and tDemands.reactstatus ne REACTSTATUS_DONE }">
							<%-- <a href="${ctxFront }/rentproduct/demands/cancel?demandid=${tDemands.demandid}" class="container_table_y2 pointer"> --%>
							<a href="javascript:void(0)" class="container_table_y2 pointer" >
							<span class="cancel" style=" color: #fcb177" value="${tDemands.demandid}">取消</span></a>
						</c:if>
						<c:if test="${tDemands.reactstatus eq REACTSTATUS_CANCEL  }">
							<a href="javascript:void(0)" class="container_table_y2 pointer" >
							<span class="deldels" style=" color: #fcb177" value="${tDemands.demandid}">删除</span></a>
						</c:if>
					</div>
				</td>
			</tr>
		</c:forEach>
        </table>
    </div>
</div>
</div></div>
<div id="neer" style="display: none">
    <div class="hidden_box">
        <p class="hidden_tit">
            <span></span>
            <span>是否取消当前需求</span>
        </p>
        <div class="yes">
        <input type="hidden" id="demand_id" value="">
            <a href="javascript:window.location.href=
            '${ctxFront }/rentproduct/demands/cancel?demandid='+$('#demand_id').val()" 
            class="hidd" style="margin-left: 0">是</a>

            <a href="javascript:void(0)"class="hidd" id="no">否</a>
        </div>

    </div>
</div>
<div id="deldel" style="display: none">
    <div class="hidden_box">
        <p class="hidden_tit">
            <span></span>
            <span>是否删除当前需求</span>
        </p>
        <div class="yes">
			<input type="hidden" id="demand_ids" value="" />
            <a href="javascript:window.location.href=
            '${ctxFront }/rentproduct/demands/delete?demandid='+$('#demand_ids').val()"
            class="deldel" id="yes" style="margin-left: 0">是</a>

            <a href="javascript:void(0)"class="deldel" id="delno">否</a>
        </div>

    </div>
</div>
<div style="text-align: center;">
		<div class="pagination  font_normal_size" >${page.html}</div></div>
</body>
<jsp:include page="/WEB-INF/views/layouts/foot.jsp"></jsp:include>
</html>